{% extends "base/layout.html" %}

{% block title %}Book lists {% endblock %}

{% block content %}

	<table class="list">
		<tr>
			<th>Title</th>
			<th>Author</th>
			<th></th>
			<th></th>
		</tr>
		{% if books %}

			{% for book in books %}
			<tr>
				<td><a href='{% url action="view" %}/{{ book.id }}'> {{ book.title }} </a></td>
				<td>{{ book.author_name }}</td>
                <td><a href='{% url action="edit" %}/{{ book.id }}'> Edit </a></td>
				<td><noindex><a rel="nofollow" href='{% url action="delete" %}/{{ book.id }}'> Delete </a></noindex></td>
			</tr>
			{% endfor %}
		{% else %}
			<tr>
				<td colspan="4">empty</td>
			</tr>
		{% endif %}
	</table>

	{% include "book/template/bookEditForm.html" with formTitle="Add another book" actionForm="/book/add/" %}

{% endblock %}
